<?php

function isConnected(){
	if((isset($_SESSION['login'])) && (isset($_SESSION['right']))){
		return true;
	}else{
		return false;
	};
}

function deconnect(){
    session_destroy();
}

function hasCredential( $right ){
	if(isConnected()){
		return $_SESSION['right'] >= $right;
	}else{
		return false;
	};
};

?>